package com.thinkgem.jeesite.modules.devmng.service;

import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.devmng.dao.DevchkItemAnswerDao;
import com.thinkgem.jeesite.modules.devmng.entity.DevchkItemAnswer;
import com.thinkgem.jeesite.modules.devmng.vo.DevchkItemAnswerResponse;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collections;
import java.util.List;

/**
 * Created by admin on 2017-12-3.
 */
@Service
@Transactional(readOnly = true)
public class DevchkItemAnswerService extends CrudService<DevchkItemAnswerDao, DevchkItemAnswer> {

    public int deleteByDevchkItemId(String devchkItemId) {
        return this.dao.deleteByDevchkItemId(devchkItemId);
    }

    public List<DevchkItemAnswer> listByDevchkItemId(String devchkItemId) {
        return this.dao.listByDevchkItemId(devchkItemId);
    }

    public List<DevchkItemAnswerResponse> listByDevchkItemIds(List<String> devchkItemIds) {
        if (devchkItemIds == null || devchkItemIds.size() == 0) {
            return Collections.emptyList();
        }
        return this.dao.listByDevchkItemIds(devchkItemIds);
    }

}
